package DSENS;

/**
 *
 * @author teeteto
 */
import java.util.ArrayList;


public class GridNetworkManager extends NetworkManager{

    public GridNetworkManager(ArrayList<Node> network) {
        super(network);
    }

   

    @Override
    public void initNetworks() {
        for(int i=0;  i<GlobalInfo.NoNodes; i++){
            if(i<3) network.add(new GridNode(GridNode.NodeType.RB));
            else if(i<13) network.add(new GridNode(GridNode.NodeType.CE));
            else network.add(new GridNode(GridNode.NodeType.WN));
        }
        
        //Connecting RBs to CEs
        for(int i=3;  i<13; i++){
            network.get(0).addNeighbour(new Neighbour(1,i));
            network.get(1).addNeighbour(new Neighbour(1,i));
            network.get(2).addNeighbour(new Neighbour(1,i));
        }
        //Connecting CEs to WNs
        int j=0;
        for(int i=13;  i<GlobalInfo.NoNodes; i++){
            network.get(j+3).addNeighbour(new Neighbour(1,i));
            j++;
            if(j==13) j=0;
        }
 }
}
